package com.zjbti.commonview;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;


public class RadioButton extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_radio_button);

        radioButtonMr = findViewById(R.id.radioButtonMr);
        radioButtonMiss = findViewById(R.id.radioButtonMiss);
        radioButtonResult = findViewById(R.id.radioButtonResult);
        radioGroup = findViewById(R.id.radioGroup);
        radioGroup.setOnCheckedChangeListener((radioGroup,i) -> {
            if(i == R.id.radioButtonMiss){
                radioButtonResult.setText("您是女的");
            }else{
                radioButtonResult.setText("您是男的");
            }
        });
    }
}